package com.tdnn.fin.payments.entity;

public class Payment {
	private String companyName;
    private Double bankPayment;
    private Double cashPayment;
    private Double totalPayment;
    private Double totalPaymentInCurrency;
    private boolean totalRow;
    
	public Payment() {
		companyName="";
		bankPayment=(double) 0;
		cashPayment=(double) 0;
		totalPayment=(double) 0;
		totalRow=false;
	}

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public Double getBankPayment() {
        return bankPayment;
    }

    public void setBankPayment(Double bankPayment) {
        this.bankPayment = bankPayment;
        setTotalPayment();
    }

    public Double getCashPayment() {
        return cashPayment;
    }

    public void setCashPayment(Double cashPayment) {
        this.cashPayment = cashPayment;
        setTotalPayment();
    }

    public Double getTotalPayment() {
        return totalPayment;
    }

    public void setTotalPayment() {
        this.totalPayment = this.bankPayment + this.cashPayment;
    }
    
    public Double getTotalPaymentInCurrency() {
		return totalPaymentInCurrency;
	}

	public void setTotalPaymentInCurrency(Float currencyRate) {
		if (currencyRate==null || currencyRate==0){
			currencyRate=(float) 1;
		}
		this.totalPaymentInCurrency = this.totalPayment / currencyRate;
	}

	public boolean isTotalRow() {
		return totalRow;
	}

	public void setTotalRow(boolean totalRow) {
		this.totalRow = totalRow;
	}
	
}
